
/*-------------------------------------------------------------------------

***************** Modification History ***********************************
   @doc
   @module Menufunc.h - Header file for Menu functionality |
   @end

$Log: /SoftPay/SPK2SIM/Source/Include/menufunc.h $
**************************************************************************

   Copyright (C) 1995 by VeriFone, Inc.

   All rights reserved.  No part of this software may be reproduced,
   transmitted, transcribed, stored in a retrieval system, or translated
   into any language or computer language, in any form or by any means,
   electronic, mechanical, magnetic, optical, chemical, manual or otherwise,
   without the prior written permission of VeriFone, Inc.

---------------------------------------------------------------------------*/
#ifndef MENUFUNC_H
#define MENUFUNC_H

//****** BRG 10/06/99
#define KEY_ALP         15  // BJD: changed to be same as ALPHA_KEY in APPLIDL.H
#define PININ           272
//****** BRG 10/06/99 END

#define MENUS_STYLE			1
#define CHOICES_STYLE		2

#define MAX_MENU_FILES      2

typedef	struct	Menu
{
	short		mNumMenuItems;
	long	mMenuTitle;
	long    mLine2Msg;
	long    mLine3Msg;
	short		mMenuIdentifier;
}	Menu;

typedef	struct	MenuItem
{
	short		miItemKey;
	long    mlTranMsg;
	long	mlTitleID;
	long    mlPlaceHolder;
	short		miPasswordLevel;
	short     miPITIndex;
	short     miReDisplayMenu;
	short		miFuncIndex;
	short		miSubFuncIndex;
}	MenuItem;

typedef union   MenuElement
{
    Menu        meMenu;
    MenuItem    meItem;
}   MenuElement;

#define CARAT "V "

Menu *pmeGetCurrentMenu (void);
short	shGetCurrentMenuID (void);
int inDoTMAOperate(void);
int inCallNewMessageEvent(void);

int inCallNewGraphicEvent(void);
int inCallNewVoucherEvent(void);
int inCallNewReportEvent(void);

int inGetIndexForMenu (int inMenuNum);
static int inFirstLn( void );

//int inGetMenusFileName(char *pchMenusFileName, int  inSizeOf);
int inDefaultGetMenusFileName(char *pchMenusFileName, int  inSizeOf);

int inGetFieldWidth( void );
void SetItemText(char *szItemText, char *szLine1, char *szLine2, int inItemNum);
void vdUpdateMenu(void);
static int inFirstScreen(MenuItem *pmeDisplayItem);
static long lnAllocateMenu(void);
void vdSelectMenu(int inMenuNum);
int inEventResponder (int inEventCode);
int inAKeyResponder(void);
int inBKeyResponder(void);
int inCKeyResponder(void);
int inDKeyResponder(void);
int inImamF0KeyResponder(void);
int inEKeyResponder(void);
int inFKeyResponder(void);
int inGKeyResponder(void);
int inHKeyResponder(void);
int inImamF5KeyResponder(void);
int in1KeyResponder(void);
int in2KeyResponder(void);
int in3KeyResponder(void);
int in4KeyResponder(void);
int in5KeyResponder(void);
int in6KeyResponder(void);
int in7KeyResponder(void);
int in8KeyResponder(void);
int in9KeyResponder(void);
int in0KeyResponder(void);
int inStarKeyResponder(void);
int inPoundKeyResponder(void);
int inCancelKeyResponder(void);
int inBackSpaceKeyResponder(void);
int inAlphaKeyResponder(void);
int inEnterKeyResponder(void);
int inCardResponder(void);
int inModemInResponder(void);
int inPinInResponder(void);
int inC1_InResponder(void);
int inC2_InResponder(void);
int inC3_InResponder(void);
int inICC1Responder(void);
int inICC2Responder(void);
short inAppl_activate(void);
short inAppl_deactivate(void);


int idle_exit (int state);
int inNoKeyPoll (int    state);
void trap_clr_key_disabled (int trap_num);
void vdDisableClearKey (int inAction);
void trap_ckrdr_disabled (int trap_num);
void vdDisableCheckReader (int inAction);
void vdClearKeyGuardSlot (int inAction);
void trap_clr_key (int trap_num);
short slow_poll(void);
short fast_poll(void);
void vdInitMenus(void);
int idle_logo_orig (void);
VS_BOOL fUpdateMenus(TRANSACTION_OBJECT *pobTran);
static int inGetLastMenu(int inLastMenu, int *pInExplicitRet, int inClrKey, int inNoOp);
VS_BOOL fRootMenu (void);
int inDisplayMenu (int inMenuIndex, short shStyle);
void vdSelectDisplayMenu(int inMenuNum, short shStyle);
void vdUpdateDisplayMenu(short shStyle);
short shNumItemsPerDisplayPage(short shStyle);
int	inC3IN_Functionality (TRANSACTION_OBJECT *pobTran);
int inDoVMACCardSelect(void);
int inGetVMACSelectCArdData(char * pucCardData);
int inCheckVMACCardSelect(void);
int inDoSPOperation(void);
int inDoActivate(void);
int inDoDeActivate(void);
int inDoMAMOperate(void);
int inDoEESLEvent(void);

//For ICICI
int inICICICustomDeActivate(void);

extern void vdLoadExternalEventData(TRANSACTION_OBJECT *pobTran);
extern void vdLoadExternalRespData(TRANSACTION_OBJECT *pobTran, int);

int MENUFUNC_CODE_CHECK(char * a,char *b,short *  c,char * d,unsigned char * e);

//meca 20041023 -- fixed from cashcard O3750 -- for auto-processing in multi-app environment (bruce/sadiq) -- start
int inBackToIdle(void);
int inPostSelfActivate(void);
int inSendReceiveEvent(short shInEvent, short shOutEvent);
//meca 20041023 -- fixed from cashcard O3750 -- for auto-processing in multi-app environment (bruce/sadiq) -- end

extern void vdTrimLeadSpaces(char* pchString);

#endif // MENUFUNC_H
